#pragma once
#include<stdio.h>
#include<stdlib.h>

#define MAX_VERTEX_NUM 100

int Visted[MAX_VERTEX_NUM];

typedef struct ArcNode
{
	int adjvex;
	struct ArcNode* nextArc;
}ArcNode;

typedef int VertexType;

typedef struct Vnode
{
	VertexType data;
	ArcNode* first;
}Vnode, AdjList[MAX_VERTEX_NUM];

typedef enum GraphKind
{
	N,
	GD,
	UDG
}GraphKind;

typedef struct AlGraph
{
	AdjList vertexs;
	int vernum;
	int arcnum;
	GraphKind kind;
}AlGraph;

void CreateGraph(AlGraph* G);

int VerLocate(AlGraph* G, VertexType x);

void PrintGraph(AlGraph* G);

void DestroyGraph(AlGraph* G);

void DFS(AlGraph* G, int v);
